home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.cs.arizona.edu
/
ftp.cs.arizona.edu.tar
/
ftp.cs.arizona.edu
/
icon
/
newsgrp
/
group93b.txt
/
000100_icon-group-sender _Mon May 17 08:41:30 1993.msg
< prev
next >
Wrap
Internet Message Format
|
1993-06-16
|
3KB
Received: from owl.CS.Arizona.EDU by cheltenham.cs.arizona.edu; Mon, 17 May 1993 09:19:07 MST
Received: by owl.cs.arizona.edu; Mon, 17 May 1993 09:19:06 MST
Message-Id: <9305171538.AA58087@enlil.premenos.sf.ca.us>
From: Ken Walker <kwalker@shara.premenos.sf.ca.us>
Subject: Re: Icon vs Prolog, docs, availability ?
To: icon-group@cs.arizona.edu
Date: Mon, 17 May 93 8:41:30 PDT
In-Reply-To: <borbor-130593120939@129.194.82.105>; from "Boris Borcic" at May 13, 93 10:28 am
Mailer: Elm [revision: 66.25]
Status: R
Errors-To: icon-group-errors@cs.arizona.edu
> Boris Borcic <borbor@divsun.unige.ch> writes:
>
> I have read in this group that Icon uses a backtracking
> mechanism very similar to Prolog. Would a user of both
> languages care to sketch Icon with Prolog as background ?
> What are the most significant differences ?
- Icon does not have unification or even tree pattern matching.
Tree and list processing can certainly be done, but some things
are far less elegant than in Prolog.
- Icon is strongly oriented toward string manipulation; string
scanning is the most fully developed built-in facility that
uses backtracking.
- In Prolog, data backtracking is an inescapable part of the language.
In Icon, there are two kinds of assignments, those that are undone
upon backtracking and those that are not. The latter are typically
used much more than the former; Icon programs are not declarative.
- Icon has control structures that look similar to those of more
conventional programming langauges, but have somewhat different
semantics in that they use and control success and failure rather
than being driven by boolean values. Many of these control structure
lexically limit backtracking; there is nothing as messy as Prolog's
"cut".
> What typical problems are there, if any,
> that are easy to solve in Icon but not in Prolog, and vice-versa ?
>
> For instance, it is at times desirable to constrain the
> search for further solutions in a way that depends on the
> solutions already found. IMHO, the declarative leaning of Prolog's
> backtracking makes this difficult and unnatural to program.
> Does Icon let me do this naturally ?
I never got to the point where I felt I could "think in Prolog", so
I'm not sure I can make a fair comparison at this level. Prolog gives
you a very simple, very high-level programming model. If your problem
fits easily into that model, Prolog is beautiful to program in. How
may problems fit the model may depend on how you are able to think
about them (sorry if this is rather vague). Icon, on the other hand,
has more features and as an imperative languages gives you more
control and more flexibility. It might be interesting to look at
specific problems.
Ken Walker, kwalker@premenos.sf.ca.us